<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>ShoesShopping管理员后台</title>
		
		<!-- CSS -->
		<link id="easyuiTheme" rel="stylesheet" href="jquery-easyui-1.3.4/themes/bootstrap/easyui.css" type="text/css"></link>
		<link rel="stylesheet" href="jquery-easyui-1.3.4/themes/icon.css" type="text/css"></link>
		
		<!-- JS -->
		<script type="text/javascript" src="jquery-easyui-1.3.4/jquery.min.js" charset="UTF-8"></script>
		<script type="text/javascript" src="jquery-easyui-1.3.4/jquery.easyui.min.js" charset="UTF-8"></script>
		<script type="text/javascript" src="jquery-easyui-1.3.4/locale/easyui-lang-zh_CN.js" charset="UTF-8"></script>

	</head>

	<body>
	<script type="text/javascript">
	
	</script>
	<table id="centerDataGrid" class="easyui-datagrid"
					url="userAdmin/userAdmin_list" toolbar="#tb"
					title="用户列表" iconCls="icon-save"
					rownumbers="true" pagination="true"
					fitColumns="true" striped="true"
					singleSelect="true" idField="id"
					fit="true" border="false"
					sortName="username" sortOrder="asc"
					nowrap=true>
		<thead>
			<tr>
				<th field="id" checkbox="true" >Id</th>
				<th field="username" width="20px" sortable="true">名字</th>
				<th field=email width="20px">邮箱</th>
				<th field="balance" width="20px" >余额</th>
			</tr>                          
		</thead>                          
		                          
	</table>
	
	<div id="tb" style="padding:5px;height:auto">
		<div style="margin-bottom:5px">
			<a id="addBtn" href="admin/page/center/userAdmin/user-edit.jsp" class="easyui-linkbutton" iconCls="icon-add" plain="true">增加</a>
			<!-- <a id="removeBtn" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a> -->
			<a id="editBtn" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a>
			<a id="addressBtn" href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" plain="true">查看地址列表</a>
		</div>
	</div>
	
</body>

<script type="text/javascript">
	
	$(function(){    
	    $('#removeBtn').bind('click', function(){    
	        var row = $('#centerDataGrid').datagrid('getSelected');
			if (row){
				$.messager.confirm('确认', '确认删除所选行', function(flag){
					if (flag){
						$.ajax({type:'post' , url:'userAdmin/userAdmin_delete' , data:{id:row.id} , dataType:'json',
							success : function(r){$('#centerDataGrid').datagrid('load');}
						});
					}
				});
			}
		});
		   
    	$('#editBtn').bind('click', function(){
    	 	var row = $('#centerDataGrid').datagrid('getSelected');
			if (row){
				location.href = "userAdmin/userAdmin_edit?id="+row.id;
			}  
    	});   
    	
    	$('#addressBtn').bind('click', function(){
    	 	var row = $('#centerDataGrid').datagrid('getSelected');
			if (row){
				location.href = "admin/page/center/userAdmin/address-list.jsp?id="+row.id;
				//window.open("orderAdmin/orderAdmin_listItem?id="+row.id);
			}  
    	});    
 
		
	});
</script>

</html>
